#ifndef __SW_3D_MESH_H__
#define __SW_3D_MESH_H__

#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <map>
#include <vector>
#include "sweety.h"
#include "sweety_Impl_opengl3_loader.h"
#include "components/3D/sweety_3D_Engine.h"
#include "tools/sweety_ProgramObject.h"
#include "third-party/assimp/include/Importer.hpp"
#include "third-party/assimp/include/scene.h"
#include "third-party/assimp/include/postprocess.h"

using namespace std;

namespace SW
{
    struct Vertex {
        // Position
        vec3 Position;
        // Normal
        vec3 Normal;
        // TexCoords
        vec2 TexCoords;
    };

    struct Texture {
        GLuint id;
        string type;
        aiString path;
    };

    class Mesh
    {
    public:
        /*  Mesh Data  */
        vector<Vertex> vertices;
        vector<GLuint> indices;
        vector<Texture> textures;

        /*  Functions  */
        // Constructor
        Mesh(vector<Vertex> vertices, vector<GLuint> indices, vector<Texture> textures);

        // Render the mesh
        void Draw(MainProgramObj* shader);

    private:
        /*  Functions    */
        // Initializes all the buffer objects/arrays
        void SetupMesh();

    private:
        /*  Render data  */
        GLuint VAO, VBO, EBO;        
    };
}



#endif

